home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / objc.vim < prev    next >
Encoding:
Text File  |  2001-05-10  |  2.2 KB  |  80 lines

  1. " Vim syntax file
  2. " Language:    Objective C
  3. " Maintainer:    Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de>
  4. " Last Change:    2001 May 09
  5.  
  6. " For version 5.x: Clear all syntax items
  7. " For version 6.x: Quit when a syntax file was already loaded
  8. if version < 600
  9.   syntax clear
  10. elseif exists("b:current_syntax")
  11.   finish
  12. endif
  13.  
  14. " Read the C syntax to start with
  15. if version < 600
  16.   source <sfile>:p:h/c.vim
  17. else
  18.   runtime! syntax/c.vim
  19. endif
  20.  
  21. " Objective C extentions follow below
  22. "
  23. " NOTE: Objective C is abbreviated to ObjC/objc
  24. " and uses *.h, *.m as file extensions!
  25.  
  26.  
  27. " ObjC keywords, types, type qualifiers etc.
  28. syn keyword objcStatement    self super _cmd
  29. syn keyword objcType            id Class SEL IMP BOOL nil Nil
  30. syn keyword objcTypeModifier bycopy in out inout oneway
  31.  
  32. " Match the ObjC #import directive (like C's #include)
  33. syn region objcImported contained start=+"+  skip=+\\\\\|\\"+  end=+"+
  34. syn match  objcImported contained "<[^>]*>"
  35. syn match  objcImport  "^#\s*import\>\s*["<]" contains=objcImported
  36.  
  37. " Match the important ObjC directives
  38. syn match  objcScopeDecl "@public\|@private\|@protected"
  39. syn match  objcDirective    "@interface\|@implementation"
  40. syn match  objcDirective    "@class\|@end\|@defs"
  41. syn match  objcDirective    "@encode\|@protocol\|@selector"
  42.  
  43. " Match the ObjC method types
  44. "
  45. " NOTE: here I match only the indicators, this looks
  46. " much nicer and reduces cluttering color highlightings.
  47. " However, if you prefer full method declaration matching
  48. " append .* at the end of the next two patterns!
  49. "
  50. syn match objcInstMethod  "^[\t\s]*-[\s]*"
  51. syn match objcFactMethod  "^[\t\s]*+[\s]*"
  52.  
  53.  
  54. " Define the default highlighting.
  55. " For version 5.7 and earlier: only when not done already
  56. " For version 5.8 and later: only when an item doesn't have highlighting yet
  57. if version >= 508 || !exists("did_objc_syntax_inits")
  58.   if version < 508
  59.     let did_objc_syntax_inits = 1
  60.     command -nargs=+ HiLink hi link <args>
  61.   else
  62.     command -nargs=+ HiLink hi def link <args>
  63.   endif
  64.  
  65.   HiLink objcImport    Include
  66.   HiLink objcImported    cString
  67.   HiLink objcType    Type
  68.   HiLink objcScopeDecl    Statement
  69.   HiLink objcInstMethod    Function
  70.   HiLink objcFactMethod    Function
  71.   HiLink objcStatement    Statement
  72.   HiLink objcDirective    Statement
  73.  
  74.   delcommand HiLink
  75. endif
  76.  
  77. let b:current_syntax = "objc"
  78.  
  79. " vim: ts=8
  80.